package study;

import lombok.extern.log4j.Log4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 腾讯课堂搜索【咕泡学院】
 * 官网：www.gupaoedu.com
 * 风骚的Mic 老师
 * create-date: 2020/1/7-21:56
 */
@RestController
public class HelloController {
    //出错后降级处理
    @DubboReference(mock = "study.MockHelloService",
              cluster = "failfast",loadbalance = "random") //负载均衡，默认是随机
    private IUserService iHelloService;

    @GetMapping("/say")
    public String sayHello() throws Exception{
        String result = iHelloService.getNameById("Mic");
        return result;
    }
}
